import request from '@/utils/request'

export function getCuisine (params) {
  return request({
    url: 'dish/page',
    method: 'get',
    params
  })
}
export function changeStatus (data) {
  return request({
    url: `/dish/status/${data.status}?ids=${data.ids.join()}`,
    method: 'post',
    data
  })
}
export function dishDel (data) {
  return request({
    url: `/dish?ids=${data.ids.join()}`,
    method: 'delete',
    data
  })
}
// 编辑页里获取某个菜品分类下的具体菜品
export function getDishById (id) {
  return request({
    url: '/dish/' + id,
    method: 'get'
  })
}
// 确认新增菜品
export function addDish (data) {
  return request({
    url: '/dish',
    method: 'post',
    data
  })
}

// 确认编辑菜品
export function editDish (data) {
  return request({
    url: '/dish',
    method: 'put',
    data
  })
}
// 获取某个菜品分类下的所有菜品
export function getDishesByCateId (categoryId) {
  return request({
    url: '/dish/list?categoryId=' + categoryId,
    method: 'get'
  })
}
